﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NUnit.Framework;
using HidesaburoDotNET.Core;
using HidesaburoDotNET.Core.Detecctors;
using HidesaburouDotNetTest.Test.YakuCheck;
namespace HidesaburoDotNET.Test.YakuCheck
{
    [TestFixture]
    public class KimuraCheck
    {
        [Test]
        public void TestRyuisou()
        {

            YakuDetector detector = new RyuisouDetector();
            MockAgariTehai agari = null;
            int expectedFan = 0;

            //正常時の判定
            expectedFan = 13;
            //
            agari = new MockAgariTehai(new List<Mentsu>(){
                MockAgariTehai.CreateMentsu(MentsuType.Toitsu,new Hai( HaiType.Souzu , 3)),
                MockAgariTehai.CreateMentsu(MentsuType.Anko,new Hai( HaiType.Souzu, 4)),
                MockAgariTehai.CreateMentsu(MentsuType.Minkan,new Hai( HaiType.Souzu, 2)),
                MockAgariTehai.CreateMentsu(MentsuType.Minko,new Hai( HaiType.Jihai , Hai.Hatsu)),
                MockAgariTehai.CreateMentsu(MentsuType.Anko,new Hai( HaiType.Souzu , 6))
                });
            agari.SelectAgariHai(1, 0);
            agari.Tsumo = true;
            YakuDetectorsTest.AssertCorrectlyChecked(expectedFan, detector, agari);

            //失敗時の判定
            expectedFan = 0;
            //
            agari = new MockAgariTehai(new List<Mentsu>(){
                MockAgariTehai.CreateMentsu(MentsuType.Toitsu,new Hai( HaiType.Souzu , 3)),
                MockAgariTehai.CreateMentsu(MentsuType.Anko,new Hai( HaiType.Souzu, 4)),
                MockAgariTehai.CreateMentsu(MentsuType.Minkan,new Hai( HaiType.Souzu, 2)),
                MockAgariTehai.CreateMentsu(MentsuType.Minko,new Hai( HaiType.Jihai , Hai.Haku)),
                MockAgariTehai.CreateMentsu(MentsuType.Anko,new Hai( HaiType.Souzu , 6))
                });
            agari.SelectAgariHai(2, 0);
            agari.Tsumo = true;
            YakuDetectorsTest.AssertCorrectlyChecked(expectedFan, detector, agari);

            //失敗時の判定
            expectedFan = 0;
            //
            agari = new MockAgariTehai(new List<Mentsu>(){
                MockAgariTehai.CreateMentsu(MentsuType.Toitsu,new Hai( HaiType.Souzu , 3)),
                MockAgariTehai.CreateMentsu(MentsuType.Syuntsu_A,new Hai( HaiType.Souzu, 4)),
                MockAgariTehai.CreateMentsu(MentsuType.Minkan,new Hai( HaiType.Souzu, 2)),
                MockAgariTehai.CreateMentsu(MentsuType.Minko,new Hai( HaiType.Jihai , Hai.Hatsu)),
                MockAgariTehai.CreateMentsu(MentsuType.Anko,new Hai( HaiType.Souzu , 6))
                });
            agari.SelectAgariHai(2, 0);
            agari.Tsumo = true;
            YakuDetectorsTest.AssertCorrectlyChecked(expectedFan, detector, agari);

        }
    }
}
